<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>将某个颜色定义为透明色</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.imagecolortransparent" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagecolortransparent</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">imagecolortransparent</span> &mdash; <span class="dc-title">将某个颜色定义为透明色</span></p>

 </div>
 <div class="refsect1 unknown-unknown-unknown-unknown-seealss" id="refsect1-function.imagecolortransparent-unknown-unknown-unknown-unknown-seealss">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagecolortransparent</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$image</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$color</code></span>
  ] ) : <span class="type">int</span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imagecolortransparent()</strong></span> 将
   <code class="parameter">image</code> 图像中的透明色设定为
   <code class="parameter">color</code>。<code class="parameter">image</code>
   是 <span class="function"><a href="imagecreatetruecolor.html" class="function">imagecreatetruecolor()</a></span>
   返回的图像标识符，<code class="parameter">color</code>
   是 <span class="function"><a href="imagecolorallocate.html" class="function">imagecolorallocate()</a></span> 返回的颜色标识符。
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    透明色是图像的一种属性，透明度不是颜色的属性。一旦设定了某个颜色为透明色，图像中之前画为该色的任何区域都成为透明的。
   </p>
  </p></blockquote>
  <p class="para">
   返回新透明色的标识符，如果省略 <code class="parameter">color</code> 则返回当前透明色的标识符。
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    透明度仅能通过 <span class="function"><a href="imagecopymerge.html" class="function">imagecopymerge()</a></span>
    和真彩色图像拷贝，不能用 <span class="function"><a href="imagecopy.html" class="function">imagecopy()</a></span> 或调色板图像。
   </p>
  </p></blockquote>
 </div>

</div></div></div></body></html>